﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultTPNS.aspx.cs" Inherits="Default" %>


<%@ Register Src="~/UserCtrl-PhieuChi/Header.ascx" TagName="Header" TagPrefix="gc_header" %>
<%@ Register Src="~/UserCtrl-PhieuChi/Footer.ascx" TagName="Footer" TagPrefix="gc_footer" %>

<%@ Register Src="~/UserCtrl-PhieuChi/PagerTop.ascx" TagName="PagerTop" TagPrefix="gc_pagertop" %>

<%@ Register Src="~/UserCtrl-PhieuChi/MainMenuQLNS_NV.ascx" TagName="MainMenu" TagPrefix="gc_MainMenu" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Anh Xuan - Technology</title>

    <!-- Le styles -->
    <link href="../UserControl/bootstrap/assets/css/bootstrap.css" rel="stylesheet" />
    <link href="../UserControl/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" />
    <link href="../UserControl/bootstrap/assets/css/docs.css" rel="stylesheet" />
    <link href="../UserControl/bootstrap/assets/js/google-code-prettify/prettify.css" rel="stylesheet" />

    <link rel="stylesheet" type="text/css" href="../UserControl/style_home.css" />

    <link rel="stylesheet" href="../UserControl/colorbox-master/css/colorbox.css" />

    <link rel="stylesheet" type="text/css" href="../UserControl/styles-12.css" />
    <link rel="stylesheet" href="../UserControl/datepicker/css/datepicker.css" />
    <link rel="stylesheet" href="../UserControl/jPager/css/custom-pager.css" />
    <link rel="stylesheet" href="../UserControl/jPager/css/jPaginator.css" />
    <link href="../UserControl/bootstrap/assets/css/bootstrap-select.css" rel="stylesheet" />
    <!-- jTable style file -->
    <link href="../jsGobalLib/Scripts/jtable/themes/lightcolor/green/jtable.min.css" rel="stylesheet" type="text/css" />

    <link rel="stylesheet" type="text/css" href="../JSGobalLib/jquery-ui-themes-1.10.3/themes/ui-lightness/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="../JSGobalLib/jquery-ui-themes-1.10.3/themes/ui-lightness/jquery.ui.theme.css" />

    <style type="text/css">
        .rptTable {
            margin-top: 20px;
            margin-bottom: 20px;
        }
        .hide-important {
            display: none !important;
        }
    </style>


    <script type="text/javascript" src="../jsGobalLib/xdate.js"></script>
    <script type="text/javascript" src="../jsGobalLib/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../jsGobalLib/jquery-migrate-1.2.1.js"></script>

    <script type="text/javascript" src="../jsGobalLib/jquery-ui-1.10.3/ui/jquery-ui.js"></script>
    <script type="text/javascript" src="../jsGobalLib/jquery.validate.js"></script>

    <script type="text/javascript" src="../UserControl/colorbox-master/jquery.colorbox.js"></script>
    <script type="text/javascript" src="../UserControl/datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../UserControl/jPager/js/jPaginator-min.js"></script>
    <script type="text/javascript" src="../jsGobalLib/PageInitSize.js"></script>

    <script src='../Common/gc_ShowDivData.js' type='text/javascript'></script>
    <script type="text/javascript" src="../common/gcGlobalForm.js"></script>
    <script type="text/javascript" src="../common/gcGlobal.js"></script>
    <script type="text/javascript" src="../common/Kernel.js"></script>
    <script type="text/javascript" src="../js/o.js"></script>
    <script src="../UserControl/bootstrap/assets/js/bootstrap-select.js"></script>

    <!-- Report js -->
    <script src="../Common/report.js"></script>



    <script src="../jsGobalLib/Scripts/jtablesite.js" type="text/javascript"></script>
    <!-- A helper library for JSON serialization -->
    <script type="text/javascript" src="../jsGobalLib/Scripts/jtable/external/json2.js"></script>
    <!-- Core jTable script file -->
    <script type="text/javascript" src="../jsGobalLib/Scripts/jtable/jquery.jtable.js"></script>
    <!-- ASP.NET Web Forms extension for jTable -->
    <script type="text/javascript" src="../jsGobalLib/Scripts/jtable/extensions/jquery.jtable.aspnetpagemethods.js"></script>
    <script src="../Common/report.js"></script>
    <script type="text/javascript">
        //---------------------------------------------
        function fun_BreakControlEnter(id) {
            //if (id == 'VatTuIdP72')
            //    return false;
            return false;
        }
        function pAsg(cur_gb_Obj, cur_gb_CotrolID) {
            if ($('#dropdown-database ul li.active a').attr('id') == 'a4') {
                switch (cur_gb_Obj.a) {
                    case 'pGetgcGobal_COMP_EmployeeLife':
                        cur_gb_Obj.f = ' departmentid = 26 ';
                        break;
                    case 'pGetgcGobal_TASK_Works':
                        cur_gb_Obj.f = ' departmentid = 26 ';
                        break;
                    default:
                }
            }
        }
        //---------------------------------------------

        function FocusCmbText(strId, e) {
            cur_gb_CotrolID = strId;
            if (cur_gb_CotrolID)
                gc_GetListData(strId, e);
        }
        function gc_GetListData(strId, ev) {
            var ev = ev || window.event;
            var keyCode = (ev == null) ? -1 : (ev.keyCode || ev.which);
            /* tab null backspace , minus*/
            if (keyCode == 9 || keyCode == 16 || keyCode == 17) {
                $("#divShowID").hide();
                return;
            }
            else if (keyCode == 40) {
                gc_fn_Gobal_ProcessArrowDown(strId, ev);
                ev.preventDefault();
                return;
            }
            else if (keyCode == 38) {
                gc_fn_Gobal_ProcessArrowUp(strId, ev);
                ev.preventDefault();
                return;
            }
            else if (keyCode == 13) {
                var ctrlTmp = $get('itemid' + cur_gb_Index.toString());
                if (ctrlTmp != null)
                    ctrlTmp.onclick();

                return;
            }
            cur_gb_Obj = gcGobal_INCOM_Receipt.create();
            cur_gb_Obj.Id = "-9999";
            cur_gb_CotrolID = strId;

            /*check have space at the end*/
            var value = $get(cur_gb_CotrolID).value;
            //        if (value.indexOf('101'))
            //            value += ' ';
            if (value.length > 0 && value[value.length - 1] != ' ')
                return true;
            /*end check*/
            cur_gb_FlagControlCmb = 0;
            gb_strFilter = ' '; /*reset filter*/
            if (cur_gb_CotrolID) {
                cur_gb_Index = -1;


                $("#" + cur_gb_CotrolID).removeClass("gc-style-form-combo");
                $("#" + cur_gb_CotrolID).addClass("loader");
                //không cần truyền user vì dư thừa chúng ta có thể check dc bằng server.
                if (cur_gb_CotrolID == 'cmb_CourseID') /* check ID for get object*/
                    WSgcGobal_TRAINNING_COURSE_CLASS.getCourseIdName(value, gb_NumComboBox, gb_strFilter, cur_gb_Obj, cur_gb_Account, showPopupDivData, gc_gb_fn_LoadComboFail);
                else if (cur_gb_CotrolID == 'gcReportTypeID') {
                    cur_gb_FlagControlCmb = 1;
                    updateDivReport(StrStatusKH);
                }
            }
        }
        function test(strId, ev, s, tt, cc) {
            var ev = ev || window.event;
            var keyCode = (ev == null) ? -1 : (ev.keyCode || ev.which);
            /* tab null backspace , minus*/
            if (keyCode == 9 || keyCode == 16 || keyCode == 17) {
                $('#divShowID').hide(); return;
            }
            else if (keyCode == 40) {
                gc_fn_Gobal_ProcessArrowDown(strId, ev); ev.preventDefault(); return;
            }
            else if (keyCode == 38) {
                gc_fn_Gobal_ProcessArrowUp(strId, ev); ev.preventDefault(); return;
            }
            else if (keyCode == 13) {
                if (ev.ctrlKey == 1 || ev.ctrlKey == true)
                    if (typeof pe_io == 'function')
                        pe_oi(strId, ev, s);
                    else {
                        var ctrlTmp = $get('itemid' + cur_gb_Index.toString()); if (ctrlTmp != null) ctrlTmp.onclick();
                        return;
                    }
            }
            cur_gb_CotrolID = strId;
            /*check have space at the end*/
            var value = $get(cur_gb_CotrolID).value;
            //if (value.length > 0 && value[value.length - 1] != ' ')
            //    return true;
            /*end check*/
            cur_gb_FlagControlCmb = 0;

            gb_strFilter = ' '; /*reset filter*/
            if (cur_gb_CotrolID) {
                var cl = cc.ra('~', ',');
                cl = 'Id,' + cl;
                cur_gb_Obj = new Object();
                cur_gb_Index = -1;
                cur_gb_Obj.Id = '-9999';
                cur_gb_Obj.v = value;
                cur_gb_Obj.n = gb_NumComboBox;
                cur_gb_Obj.f = gb_strFilter;
                cur_gb_Obj.fid = cur_gb_CotrolID;
                //cur_gb_Obj.oid = s.__id;
                cur_gb_Obj.a = 'pGet' + tt;
                cur_gb_Obj.c = '';
                cur_gb_Obj.d = '';
                cur_gb_Obj.type = 'p';
                cur_gb_Obj.cl = cl;
                cur_gb_Obj.si = 1;
                cur_gb_Obj.mr = 25;
                //  obj: { a: 'pGet' + s._e[0], c: '', d: '', type: 'p', cl: '*', si: 1, mr: 25, se: ' Id desc', f: gb_strFilterGrid }
                $('#' + cur_gb_CotrolID).removeClass('gc-style-form-combo');
                $('#' + cur_gb_CotrolID).addClass('loader');
                //không cần truyền user vì dư thừa chúng ta có thể check dc bằng server.
                Kernel.P(cur_gb_Obj, shd);
            }
        }

        var o278 = {//gcGobal_TASK_Assignment 
            _v: ['gcGobal_TASK_Assignment', 'Id', 'Nhân viên ', 'Công việc', 'Loại công việc ', 'Tiêu chí ', 'Tình trạng ', 'Mức độ ', 'Sự kiện ', 'Ngoại lệ ', 'Mô tả kết quả ', 'Ghi chú ', 'Ngày bắt đầu', 'Ngày kết thúc', 'Nhắc nhở', 'Số lần nhắc nhở', 'Nhắc trước ', 'Thời gian nhắc', 'Điểm ', 'Điểm trừ ', 'Điểm cộng ', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'username/userid/departmentid/agentid/compid', 'Vietnamese for name or orther', 'userid/agentid/departmentid/compid/action/data', ],
            _e: ['gcGobal_TASK_Assignment', 'Id', 'EmployeeId', 'WorkId', 'WorkTypeId', 'CriteriaId', 'TaskStatusId', 'WorkLevelId', 'WorkEventId', 'WorkExternalId', 'DescriptResult', 'Note', 'StartDate', 'EndDate', 'Reminder', 'NumReminder', 'BeforeTimeReminder', 'TimeReminder', 'Marks', 'SubMarks', 'AddMarks', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'isPrgPartComp', 'isPrgVNInfo', 'isPrgHistoryInfo', ],
            _d: ["00,00,0,1,0,,,,", "01,01,1,1,1,gcGobal_COMP_EmployeeLife,MaBarCode~Hoten,29,|03,03,0,1,1,gcGobal_TASK_Work_Types,Code~Name,31,", "02,02,1,1,1,gcGobal_TASK_Works,Code~Name,30,|04,04,0,1,1,gcGobal_TASK_Criteria,Code~Name,32,|07,07,1,1,1,gcGobal_TASK_Event,Code~Name,35,", "05,05,1,1,1,gcGobal_TASK_Status,Code~Name,33,|08,08,1,1,1,gcGobal_TASK_Work_External_Assignment,Name,36,", "06,06,0,1,1,gcGobal_TASK_Work_Levels,Code~Name,34,", "09,09,1,4,0,,,,|10,10,1,4,0,,,,", "11,11,1,5,0,,,,|12,12,1,5,0,,,,", "13,13,0,1,0,,,,", "14,14,0,1,0,,,,", "15,15,0,1,0,,,,", "16,16,0,1,0,,,,", "17,17,1,2,0,,,,|18,18,1,2,0,,,,", "19,19,1,2,0,,,,", "20,20,0,1,0,,,,", "21,21,0,1,0,,,,", "22,22,0,1,0,,,,", "23,23,0,5,0,,,,", "24,24,0,5,0,,,,", "25,25,0,4,0,,,,", "26,26,0,4,0,,,,", "27,27,0,4,0,,,,", ],
            _f: [], _r: [], _coj: {}, __id: 278, _sy: 'dlg_cl', id: 'o278', cssb: 'inputBtnBottomV2', $dw: null, dwcss: 'login_sign',
        };
        var o281 = {//gcGobal_TASK_Event 
            _v: ['gcGobal_TASK_Event', 'Id', 'Mã ', 'Tên ', 'Họ ', 'Loại công việc', 'Tiêu chí', 'Mô tả ', 'Ngày bắt đầu', 'Ngày kết thúc', 'Ghi chú ', 'Nhắc nhở', 'Số lần nhắc nhở', 'Nhắc nhở trước', 'Thời gian nhắc nhở', 'Điểm ', 'Điểm trừ ', 'Điểm cộng ', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'username/userid/departmentid/agentid/compid', 'Vietnamese for name or orther', 'userid/agentid/departmentid/compid/action/data', ],
            _e: ['gcGobal_TASK_Event', 'Id', 'Code', 'Name', 'ENGName', 'WorkTypeId', 'CriteriaId', 'Description', 'StartDate', 'EndDate', 'Note', 'Reminder', 'NumReminder', 'BeforeTimeReminder', 'TimeReminder', 'Marks', 'SubMarks', 'AddMarks', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'isPrgPartComp', 'isPrgVNInfo', 'isPrgHistoryInfo', ],
            _d: ["00,00,0,1,0,,,,", "01,01,1,4,0,,,,|02,02,1,4,0,,,,", "03,03,0,4,0,,,,", "04,04,1,1,1,gcGobal_TASK_Work_Types,Code~Name,26,|05,05,1,1,1,gcGobal_TASK_Criteria,Code~Name,27,", "06,06,1,4,0,,,,|09,09,1,4,0,,,,", "07,07,1,5,0,,,,|08,08,1,5,0,,,,", "10,10,0,1,0,,,,", "11,11,0,1,0,,,,", "12,12,0,1,0,,,,", "13,13,0,1,0,,,,", "14,14,1,2,0,,,,|15,15,1,2,0,,,,", "16,16,1,2,0,,,,", "17,17,0,1,0,,,,", "18,18,0,1,0,,,,", "19,19,0,1,0,,,,", "20,20,0,5,0,,,,", "21,21,0,5,0,,,,", "22,22,0,4,0,,,,", "23,23,0,4,0,,,,", "24,24,0,4,0,,,,", ],
            _f: [], _r: [], _coj: {}, __id: 281, _sy: 'dlg_cl', id: 'o281', cssb: 'inputBtnBottomV2', $dw: null, dwcss: 'login_sign',
        };
        var o283 = {//gcGobal_TASK_Work_External_Assignment 
            _v: ['gcGobal_TASK_Work_External_Assignment', 'Id', 'Tiêu chí ', 'Loại công việc ', 'Tên ', 'Mô tả ', 'Ghi chú ', 'Ngày bắt đầu', 'Ngày kết thúc', 'Nhắc nhở  ', 'Số lần nhắc  ', 'Nhắc nhở trước  ', 'Thời gian nhắc  ', 'Điểm  ', 'Điểm trừ  ', 'Điểm cộng  ', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'username/userid/departmentid/agentid/compid', 'Vietnamese for name or orther', 'userid/agentid/departmentid/compid/action/data', ],
            _e: ['gcGobal_TASK_Work_External_Assignment', 'Id', 'CriteriaId', 'WorkTypeId', 'Name', 'DescriptResult', 'Note', 'StartDate', 'EndDate', 'Reminder', 'NumReminder', 'BeforeTimeReminder', 'TimeReminder', 'Marks', 'SubMarks', 'AddMarks', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'isPrgPartComp', 'isPrgVNInfo', 'isPrgHistoryInfo', ],
            _d: ["00,00,0,1,0,,,,", "01,01,0,1,1,gcGobal_TASK_Criteria,Code~Name,24,|03,03,1,4,0,,,,", "02,02,0,1,1,gcGobal_TASK_Work_Types,Code~Name,25,", "04,04,1,4,0,,,,|05,05,1,4,0,,,,", "06,06,0,5,0,,,,|07,07,0,5,0,,,,", "08,08,0,1,0,,,,|14,14,0,2,0,,,,", "09,09,0,1,0,,,,|10,10,0,1,0,,,,", "11,11,0,1,0,,,,", "12,12,0,2,0,,,,|13,13,0,2,0,,,,", "15,15,0,1,0,,,,", "16,16,0,1,0,,,,", "17,17,0,1,0,,,,", "18,18,0,5,0,,,,", "19,19,0,5,0,,,,", "20,20,0,4,0,,,,", "21,21,0,4,0,,,,", "22,22,0,4,0,,,,", ],
            _f: [], _r: [], _coj: {}, __id: 283, _sy: 'dlg_cl', id: 'o283', cssb: 'inputBtnBottomV2', $dw: null, dwcss: 'login_sign',
        };
        var o287 = {//gcGobal_TASK_Works 
            _v: ['gcGobal_TASK_Works', 'Id', 'Mã công việc ', 'Tên công việc ', 'Tên tiếng anh ', 'Mô tả', 'Phòng ban ', 'Loại công việc  ', 'Tiêu chí ', 'Ngày bắt đầu', 'Ngày kết thúc', 'Ghi chú ', 'Nhắc nhở  ', 'Số lần nhắc ', 'Nhắc nhở trước  ', 'Thời gian nhắc  ', 'Điểm  ', 'Điểm trừ  ', 'Điểm cộng  ', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'username/userid/departmentid/agentid/compid', 'Vietnamese for name or orther', 'userid/agentid/departmentid/compid/action/data', ],
            _e: ['gcGobal_TASK_Works', 'Id', 'Code', 'Name', 'ENGName', 'Description', 'DepartmentId', 'WorkTypeId', 'CriteriaId', 'StartDate', 'EndDate', 'Note', 'Reminder', 'NumReminder', 'BeforeTimeReminder', 'TimeReminder', 'Marks', 'SubMarks', 'AddMarks', 'isPrgStatus', 'isPrgAccountId', 'isPrgAccountUId', 'isPrgCreatedDate', 'isPrgUpdatedDate', 'isPrgPartComp', 'isPrgVNInfo', 'isPrgHistoryInfo', ],
            _d: ["00,00,0,1,0,,,,", "01,01,1,4,0,,,,|02,02,1,4,0,,,,", "03,03,0,4,0,,,,", "04,04,1,4,0,,,,|07,07,1,1,1,gcGobal_TASK_Criteria,Code~Name,29,", "05,05,1,1,1,gcGobal_COMP_Department,CODE~Name,27,|06,06,1,1,1,gcGobal_TASK_Work_Types,Code~Name,28,", "08,08,0,5,0,,,,", "09,09,0,5,0,,,,", "10,10,1,4,0,,,,|15,15,1,2,0,,,,", "11,11,0,1,0,,,,", "12,12,0,1,0,,,,", "13,13,0,1,0,,,,", "14,14,0,1,0,,,,", "16,16,1,2,0,,,,|17,17,1,2,0,,,,", "18,18,0,1,0,,,,", "19,19,0,1,0,,,,", "20,20,0,1,0,,,,", "21,21,0,5,0,,,,", "22,22,0,5,0,,,,", "23,23,0,4,0,,,,", "24,24,0,4,0,,,,", "25,25,0,4,0,,,,", ],
            _f: [], _r: [], _coj: {}, __id: 287, _sy: 'dlg_cl', id: 'o287', cssb: 'inputBtnBottomV2', $dw: null, dwcss: 'login_sign',
        };


        function pGe_o(sr) {
            var allow = false;
            if ($('#dropdown-database ul li.active a').attr('id') == 'a1') {
                allow = true;
                sr = ",d: {width: '1%',sorting: false, type: 'img',title: '', display: function (data) { var $img=$(\"<div class='gimg'></div>\"); return $img; } } "
            }
            return {
                allow: allow,
                sr: sr
            };
        };

        function pCW(v, _s, ti, i, ii, ic, f0) {
            if (_s.__id == 287 && _s._e[ic + 1] == 'Name')
                v = new String(",f|0|: {" + ((ii[2] == '0') ? 'list: false,' : '') + "title: '|1|', width: '40%', display: function (data) { return (data.record.f|2| ==null)?'':data.record.f|2|+'' }  } ").f2(f0, ti, ii[1]);
            else if (_s.__id == 278 && _s._e[ic + 1] == 'WorkId') {
                v = new String(",f|0|: {" + ((ii[2] == '0') ? 'list: false,' : '') + "title: '|1|', width: '30%', display: function (data) { return (data.record.f|2| ==null)?'':data.record.f|2|+'' }  } ").f2(f0, ti, (parseInt(ii[7]) - 1) + '');
            } else if (_s.__id == 278 && _s._e[ic + 1] == 'DescriptResult')
                v = new String(",f|0|: {" + ((ii[2] == '0') ? 'list: false,' : '') + "title: '|1|', width: '25%', display: function (data) { return (data.record.f|2| ==null)?'':data.record.f|2|+'' }  } ").f2(f0, ti, ii[1]);

            return v;
        };

        function pCDT(o, id) {
            if (id == 278) {
                o.f11 = o.f11.substring(0, 10) + ' 00:00';
                o.f12 = o.f12.substring(0, 10) + ' 23:59';
            }
        };

        function pVd(s) {
            var flag = false;
            if ($('#fo27805h').val() == '1' && $('#fo27809i').val() == '' && $('#dropdown-database ul li.active a').attr('id') == 'a1') {
                flag = true;
                alert('Để chuyển hoàn thành bạn phải điền thông tin vào mô tả kết quả');
            }
            return flag;
        }

        function pCb() {
            if ($('#o278').length > 0 && $('#o278_i').length > 0) {
                var $tr = $('#o278_i').find('.jtable tbody tr');
                $tr.each(function (i, el) {
                    //console.log($(el).find('td:nth-child(5)').text());
                    if ($(el).find('td:nth-child(5)').text() == 'CHT') {
                        $(el).attr('style', 'background-color: #f07400 ');
                    }
                });
            }
        }

        function view($that, $container, o, on) {
            // move html to content in right of screen and style width
            var parentWidth = $container.parent().innerWidth();
            var html = $(on).html();
            var $title = $('<h3 style="font-size: 18px; color: rgb(58, 135, 173);"/>').text($that.find('a').text());
            $container.empty().prepend($(on)).css({ "width": parentWidth + "px" });
            $(on).before($title);


            // Hide button "Dong cua so"
            var $listButton = $container.find('.inputBtnBottomV2');
            $listButton.find('.btn.btn-warning.btn-sm').hide();

            // Margin input
            var $inputFirst = $container.find('div.input').find('input:first');//.not('#fo28605i');
            $inputFirst.each(function () {
                if ($that.attr('id') == "fo28605i") {
                    $that.css({ 'margin-right': '5px' });
                }
                else {
                    $that.css({ 'margin-right': '35px' });
                }
            });

            // Add type to all input button in form
            switch ($that.find('a').attr('id')) {
                case 'a1':
                    $container.find('#r01o278').addClass('hide-important');
                    $container.find('#r02o278').addClass('hide-important');
                    //$container.find('#r05o278').addClass('hide-important');
                    $container.find('#r06o278').addClass('hide-important');
                    $container.find('#r11o278').addClass('hide-important');
                    $container.find('#r12o278').addClass('hide-important');
                    $container.find('#fo27808i').addClass('hide-important');
                    $container.find('#lo27808i').addClass('hide-important');
                    $container.find('#r20o278').attr('style', '');
                    //$container.find('#fo27810i').addClass('hide-important');
                    //$container.find('#lo27810i').addClass('hide-important');
                    $container.find('.btn.btn-primary.btn-sm').addClass('hide-important');

                    var $text = $('<textarea id="fo27809i"/>').addClass('brwidthinput200 form-control');
                    $container.find('#fo27809i').remove();
                    $container.find('#lo27809i').after($text);

                    break;
                case 'a5':
                case 'a6':
                case 'a7':
                case 'a8':
                    $('#r01o278').addClass('hide-important');
                    $('#r02o278').addClass('hide-important');
                    $('#r06o278').addClass('hide-important');
                    $('#lo27808i').addClass('hide-important');
                    $('#fo27808i').addClass('hide-important');
                    $container.find('.btn.btn-primary.btn-sm').addClass('hide-important');
                    break;
                default:
            }

        }


        $(document).ready(function () {

            $("#ThemVuViecBtn").click(function (ev) {
                _gb.pr(o73).ff(true, o73);
                _gb.rf(o73);
                gb_curBoxDlg = $("#ThemVuViecBtn").colorbox({ inline: true, width: "97%", height: "97%", href: "#o73", title: _gb.ll(0, o73) });
            });

            $('#dropdown-database ul li').click(function () {
                if (!$(this).hasClass('active')) {
                    $('.sidebar-content').empty();
                    $('#dropdown-database ul li').removeClass('active');
                    $(this).addClass('active');
                    var o = {};
                    var on = '';
                    switch ($(this).find('a').attr('id')) {
                        case 'a1': o = o278; on = '#o278';
                            gb_strFilterGrid = " (criteriaid is null or criteriaid = 8) and employeeid = <%= Session["gcMaCanBoId"] %> and endDate >= '"
                                + dateToString(XDate.today(), 'iso') + "' ";
                            break;
                        case 'a2': o = o283; on = '#o283';
                            gb_strFilterGrid = ''; break;
                        case 'a4': o = o278; on = '#o278';
                            gb_strFilterGrid = ' (criteriaid is null or criteriaid = 8) and employeeid in (select id from gcgobal_comp_employeelife where departmentid = 26) ';
                            break;
                        case 'a5': o = o278; on = '#o278';
                            gb_strFilterGrid = ' criteriaid = 11 ';
                            break;
                        case 'a6': o = o278; on = '#o278';
                            gb_strFilterGrid = ' criteriaid = 10 ';
                            break;
                        case 'a7': o = o278; on = '#o278';
                            gb_strFilterGrid = ' criteriaid = 9 ';
                            break;
                        case 'a8': o = o278; on = '#o278';
                            gb_strFilterGrid = ' criteriaid = 6 ';
                            break;
                        case 'a10': o = o283; on = '#o283'; break;
                        case 'a11': o = o18; on = '#o18'; break; //Employee
                        case 'a12': o = o17; on = '#o17'; break; //Department
                        default:
                        }
                        _gb.pr(o).ff(true, o);
                        _gb.rf(o);

                    // Xử lý view
                        view($(this), $('.sidebar-content'), o, on);
                    }
            });
            var t = setTimeout(function () {
                $('#dropdown-database ul li #a1').trigger('click');
                clearTimeout(t);
            }, 500);
            $('#fbc00i').click(function (ev) {
                test('fbc00i', ev, '', 'gcGobal_COMP_EmployeeLife', 'HoTen');
            });
            $('#fbc01i').click(function (ev) {
                test('fbc01i', ev, '', 'gcGobal_COMP_Department', 'Code~Name');
            });
            $('#InBillBtn').click(function () {
                var flag = false;
                var rpVal = $('#typeID').val();
                var obj = {};
                switch (rpVal) {
                    case 'rp1':
                        rp1(obj, $('#fbc01h').val());
                        break;
                    case 'rp2':
                        rp2(obj, $('#NgayBatDauIdNew').val().replace(/\//g, '-'), $('#NgayKetThucIdNew').val().replace(/\//g, '-'), $('#fbc00h').val(), $('#fbc01h').val());
                        break;
                    case 'rp3':
                        rp3(obj, $('#NgayBatDauIdNew').val().replace(/\//g, '-'), $('#NgayKetThucIdNew').val().replace(/\//g, '-'), $('#fbc00h').val(), $('#fbc01h').val());
                        break;
                    case 'rp4':
                        rp4(obj, $('#NgayBatDauIdNew').val().replace(/\//g, '-'), $('#NgayKetThucIdNew').val().replace(/\//g, '-'), $('#fbc00h').val(), $('#fbc01h').val());
                        break;
                    case 'rp5':
                        rp5(obj, $('#NgayBatDauIdNew').val().replace(/\//g, '-'), $('#NgayKetThucIdNew').val().replace(/\//g, '-'), $('#fbc00h').val(), $('#fbc01h').val());
                        break;
                    case 'rp6':
                        rp6(obj, $('#NgayBatDauIdNew').val().replace(/\//g, '-'), $('#NgayKetThucIdNew').val().replace(/\//g, '-'), $('#fbc00h').val(), $('#fbc01h').val());
                        break;
                    default:
                        flag = true;
                        break;
                }
                if (!flag) {
                    $.ajax({
                        type: "POST",
                        url: '/zgcReport/Report.ashx',
                        crossDomain: true,
                        data: JSON.stringify({ obj: obj }),
                        success: function (msg) {
                            showError(msg);
                        },
                        error: function () {
                            alert("Error");
                        }
                    });
                } else {
                    alert('Báo cáo loại này hiện tại chưa có');
                }
            });
            $('#reloadCV').click(function () {
                if ($('#dropdown-database ul li #a8').closest('li').hasClass('active')) {
                    $("#o287_g").jtable('load', {
                        obj: { a: 'pGet' + o287._e[0], c: '', d: '', type: 'p', cl: '*', si: 1, mr: 50, se: ' Id desc', f: ' DepartmentId = ' + $('#fbc01h').val() }
                       , jtStartIndex: 0
                       , jtPageSize: 300
                    });
                }
                if ($('#dropdown-database ul li #a9').closest('li').hasClass('active')) {
                    $("#o278_g").jtable('load', {
                        obj: { a: 'pGet' + o278._e[0], c: '', d: '', type: 'p', cl: '*', si: 1, mr: 50, se: ' Id desc', f: ' EmployeeId = ' + $('#fbc00h').val() }
                       , jtStartIndex: 0
                       , jtPageSize: 300
                    });
                }
            });

        });

            $(window).load(function () {
                cur_gb_Account = '<%= Session["gcUserName"] %>'; // có thời gian mã hóa tên của user để che lại
            cur_gb_GroupRight = '<%= Session["gcRightGroup"] %>';
            cur_gb_Branch = '<%= Session["branchId"] %>';

            //viết thành hàm configRight gọi mỗi khi cần set
            //gc_fn_Gobal_ConfigRightLoadForm();
            $("#gc_gobal_PagerTopID").hide();

            //click vao cái đầu tiên
            $("#profileTab").click();
            $('.selectpicker').selectpicker({
                'selectedText': 'cat'
            });
            setClassAll('FilterReceiptDay');
            $("#NgayBatDauIdNew").val(XDate.today().toString("dd/MM/yyyy"));
            $("#NgayKetThucIdNew").val(XDate.today().toString("dd/MM/yyyy"));
            //obj.t1 = gcDateC($("#NgayBatDauIdNew").val());
            //obj.t2 = gcDateC($("#NgayKetThucIdNew").val());
            // $('.selectpicker').selectpicker('hide');
        });



    </script>


</head>

<body>
    <a id='URLDownloadFile' style='display: none;' href=''></a>
    <form action="ClassInfo.aspx?paramExportFile=ExportToWord" method="post" id="downloaddata" style="display: none; visibility: hidden">
        <input type="submit" value="download" style="display: none; visibility: hidden" />
    </form>

    <form id="loginForm" runat="server">

        <!-- Webservice Information -->
        <asp:ScriptManager ID='gcSM' runat='server' EnablePageMethods='true' ScriptMode='Release'>
            <Services>

                <asp:ServiceReference Path="~/WSASMXGobal/Kernel.asmx" />

            </Services>
        </asp:ScriptManager>
        <!-- End webservice Information -->


        <div id="container">
            <div class="container">

                <!-- gc Header form : first time is enable-->
                <gc_MainMenu:MainMenu ID='gc_parent_MenuID' runat="server" />
                <div style="clear: both;"></div>
                <!-- End gc Header form -->

                <!-- This contains the hidden content for inline calls -->

                <div style='display: none'></div>

                <div id="FilterReceiptDay" class="content" style="padding: 0 10px 10px 10px">
                    <div class="gc_SearchForm" id="Div2">
                        <div id="Div3" class="login_sign">
                            <div class="input">
                                <label>Từ Ngày</label>
                                <input type="text" name="datepicker" id="NgayBatDauIdNew" autocomplete="off" style="background: url(&quot;../Usercontrol/images/date7.png&quot;) no-repeat scroll right 5px center rgb(255, 255, 255); padding-right: 20px; color: rgb(136, 136, 136);" class="form-control valid">
                                <label>Tới ngày</label>
                                <input type="text" name="datepicker" id="NgayKetThucIdNew" autocomplete="off" style="background: url(&quot;../Usercontrol/images/date7.png&quot;) no-repeat scroll right 5px center rgb(255, 255, 255); padding-right: 20px; color: rgb(136, 136, 136);" class="form-control">

                                <%--<label>Nhân viên :</label>
                                <input type="text" class="brwidthinput300 input-large form-control gc-style-form-combo" name="combo" id="fbc00i" value="Chọn danh sách..." autocomplete="off">--%>
                                <input type="text" style="display: none;" id="fbc00h" class="form-control" value="<%= Session["gcMaCanBoId"] %>">
                            <%--</div>

                            <div class="input">
                                <label>Chọn phòng ban:</label>
                                <input type="text" class="brwidthinput300 input-large form-control gc-style-form-combo" name="combo" id="fbc01i" value="Chọn danh sách..." autocomplete="off">--%>
                                <input type="text" style="display: none;" id="fbc01h" class="form-control" value="<%= Session["gcDepartmentId"] %>">
                            </div>
                        </div>
                        <div class="clear"></div>


                        <div class="col-lg-4">
                            <select name="master" data-live-search="true" class="selectpicker show-tick form-control" id="typeID" style="display: none;">
                                <option value="rp2" id="Option2">1. Báo cáo chi tiết nhân viên theo ngày</option>
                                <option value="rp4" id="Option4">3. Báo cáo tính điểm nhân viên theo ngày</option>
                                <option value="rp5" id="Option5">4. Báo cáo tổng hợp nhân viên theo tháng</option>
                            </select>
                        </div>

                        <input type="button" class="btn btn-primary btn-sm" id="InBillBtn" value="In Báo Cáo">

                        <%--<input type="button" class="btn btn-primary btn-sm" id="reloadCV" value="Load Công việc">--%>
                    </div>
                </div>


                <div style="clear: both;"></div>
                <!-- End gc Header form -->

                <!-- gc Search Filter : first time is enable-->

                <!-- End gc Search Filter -->



                <!-- gc Information : for notify successfull update, insert, error, first time is disable-->
                <div class="content" id="gc_gobal_InformationID">
                </div>
                <!-- End gc Information -->


                <!-- End gc Main Form -->
                <div class="content" id="gc_gobal_MainFormID">


                    <div class="alert alert-info alert-info-gc-small" id="gc_gb_MessageInfomation"><strong>Chú ý!</strong> Bạn phải gõ khoảng trắng vào ô text để search.</div>

                    <!--/tabs-->
                    <div id="content">
                        <div class="sidebar-content" style="float: left;">
                        </div>
                    </div>

                    <!-- Pager at the top -->
                    <div id="gc_ClassInformationID" class="gc_ClassInformation">

                        <div id="gc_ClassInformationInnerID" class="gc_ClassInformationInner">
                        </div>
                    </div>
                    <!-- End pager at the top -->
                    <div style="clear: both;"></div>

                    <!-- Pager at the top -->
                    <gc_pagertop:PagerTop ID="gc_pagertopID" runat="server" />
                    <!-- End pager at the top -->

                    <div id="gc_gobal_ListDataID">
                    </div>
                    <div style="clear: both;"></div>


                </div>
                <!---content-->
                <!-- End gc Main Form -->
                <div style="clear: both;"></div>


                <!-- gc Tag Main form : first time is enable-->
                <div class="content" id="gc_gobal_TagMainFormID">
                </div>
                <!-- End Tag Main form form -->

                <!-- gc Footer form : first time is enable-->
                <div class="content" id="gc_gobal_FooterMainFormID">
                </div>
                <!-- End gc Footer form -->

                <div class="content gc-gb-advice">
                    <h3 id="chuthich"></h3>
                    <%--<ul class="menu">
            	<li><a href="#" title="">Tính năng mới</a></li>
            	<li><a href="#" title="">Tạo tài khoản</a></li>
            </ul>--%>
                </div>
                <div id="report" style="display: none"></div>
            </div>
            <!--/.container-->
        </div>
        <!--/ #container-->

    </form>

    <!-- Footer Information -->
    <gc_footer:Footer ID='gc_footer_ID' runat="server" />
    <!-- End footer Information -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="../jsGobalLib/widgets.js"></script>
    <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
    <script type="text/javascript" src="../jsGobalLib/load-image.min.js"></script>
    <!-- The Canvas to Blob plugin is included for image resizing functionality -->
    <script type="text/javascript" src="../jsGobalLib/canvas-to-blob.min.js"></script>
    <!--
     <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    <script type="text/javascript" src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script>
    <script type="text/javascript" src="http://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script> 
    -->

    <script type="text/javascript" src="../UserControl/bootstrap/assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../UserControl/bootstrap/assets/js/holder.js"></script>


</body>
</html>

